package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.AnyBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.UploadHeadContract;
import com.seveneight.baijiesteward.ui.user.model.UploadHeadModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/27.
 */

public class UploadHeadPresenter implements UploadHeadContract.UploadPresenter {

    UploadHeadContract.UploadHeadView uploadHeadView;
    UploadHeadContract.UploadModel uploadModel;

    public UploadHeadPresenter(UploadHeadContract.UploadHeadView uploadHeadView) {
        this.uploadHeadView = uploadHeadView;
        uploadModel = new UploadHeadModel();
    }

    @Override
    public void uploadHeadImg(Context context, RequestBody body) {
        uploadModel.uploadHeadImg(context,body, new MyCallBack<AnyBean>() {
            @Override
            public void onSuccess(AnyBean anyBean) {
                uploadHeadView.uploadStatus();
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
